'use strict';
//获取数据库
const db = uniCloud.database()
const dbCmd = db.command // 取指令
exports.main = async (event, context) => {
	let str;
	if (event.typeid != undefined) { 
		str = {
			typeid: event.typeid,
			num: dbCmd.lt(event.maxnum)
		}
	}


	console.log(str)
	let result = await db.collection('GoodInfo').where(str).get()
	return {
		code: 200,
		msg: '数据请求成功',
		data: result.data
	}
};
